Skip to content

Conversation

@ncooke3
Copy link
Member

@ncooke3 ncooke3 commented Dec 19, 2025

GHA seems to flake when tests try to await (via XCTestExpectation) work that is done with the background priority. This queue has low priority scheduling that seems to very delayed in a test runner environment. This fix for this problem in the Crashlytics test suite (#15623) was to inject a higher priority queue during testing to ensure the awaited work gets done quickly. Since the queue in question is a concurrent queue, there is no way to reliably "drain" it as we could do with a serial queue. Should this fix start to flake in the future, we could inject a serial queue and drain it, but keeping it a concurrent queue, albeit with a higher priority seems IMO more similar to how it would run in non-test environment.

The flakes are most likely due to:

all(self.subscriberPromises.values).then(on: .global(qos: .background)) { _ in

#no-changelog

@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@ncooke3 ncooke3 mentioned this pull request Dec 19, 2025
@ncooke3
Copy link
Member Author

ncooke3 commented Dec 19, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to fix flaky tests by adding sync blocks to wait for background queue operations. The approach is sound and should improve test stability. The added block in setUp() correctly isolates tests by draining the queue from previous runs. I've added one comment on the second added block in runSessionsSDK() to suggest improving a comment for clarity and to point out code duplication that could be refactored.

@ncooke3 ncooke3 marked this pull request as ready for review January 5, 2026 17:32
@ncooke3 ncooke3 requested a review from themiswang January 5, 2026 18:22
@ncooke3 ncooke3 enabled auto-merge (squash) January 5, 2026 18:22
@ncooke3 ncooke3 merged commit b9a55b8 into main Jan 5, 2026
49 checks passed
@ncooke3 ncooke3 deleted the nc/sessions-flakes branch January 5, 2026 19:45
@ncooke3 ncooke3 mentioned this pull request Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants